home *** CD-ROM | disk | FTP | other *** search
- /*
- Preload.h
-
- Graphic Elements cross-platform compatibility headers.
-
- 11/28/95
-
- */
-
- #ifndef PRELOAD
- #define PRELOAD
-
- //----------------------------------------------------------------------------------
- // Figure out what kind of compiler we're using and what system we're compiling for
- //----------------------------------------------------------------------------------
-
-
- // Add in support for various PC compilers here
-
-
- #if defined(_MSC_VER) || defined(_INTEL_)
- #define WINDOWS_COMPILER
- #define _NO_UNUSED
- #endif
-
- /*************************************************************************
- *
- * To support platform independence, TEST_WIN and TEST_MAC may be
- * defined on the compiler command line. This chart shows the various
- * possible combinations:
- *
- * Compiled on: Command line define: Operation:
- * MAC <none> Real build for MAC
- * MAC TEST_MAC Syntax-checks MAC build
- * MAC TEST_WIN Syntax-checks WIN95 build
- * PC <none> Real build for WIN95
- * PC TEST_MAC Syntax-checks MAC build
- * PC TEST_WIN Syntax-checks WIN95 build
- *
- * Note than when performing a syntax-check build, the compiler should
- * be set up so that it does NOT include any precompiled headers of any
- * type. These builds are to help us make sure that we have not done
- * anything stupid we didn't mean to, so we have a better chance of the
- * program compiling on the other machine.
- **************************************************************************/
-
- // Set up initial test and compiler defines
-
- #if defined(TEST_WIN) && defined(TEST_MAC)
- #error "TEST_WIN overridden by TEST_MAC"
- #endif
-
- #if defined(TEST_WIN) || defined(TEST_MAC)
- #define TEST_COMPILE
- #endif
-
- #if defined(TEST_WIN) && !defined(TEST_MAC) && !defined(TARGET_IS_WIN95)
- #define TARGET_IS_WIN95
- #endif
-
- // When all is said and done, if it is not a PC, it must be a MAC
-
- #ifdef WINDOWS_COMPILER
- #ifndef TEST_COMPILE
- #if !defined(TARGET_IS_WIN95)
- #define TARGET_IS_WIN95
- #endif
- #endif
- #else
- #define MAC_COMPILER
- #endif
-
- #ifndef TARGET_IS_WIN95
- #ifdef __BEOS__
- #define TARGET_IS_BEOS
- #else
- #ifndef TARGET_IS_MACOS
- #define TARGET_IS_MACOS
- #endif
- #endif
- #endif
-
-
- //----------------------------------------------------------------------------------
- // Now we know what kind of compiler we're using and what system we're compiling for
- //----------------------------------------------------------------------------------
-
- // These macros compensate for Mac/PC compiler differences in the declaration of "pascal" functions
-
- #ifdef WINDOWS_COMPILER
- #define GE_CALLBACK(pType, pName) pType FAR PASCAL pName
- #define GE_CALLBACK_TDEF(pType, pName) typedef pType (FAR PASCAL * pName)
- #else
- #ifdef TARGET_IS_BEOS
- #define GE_CALLBACK(pType, pName) pType pName
- #define GE_CALLBACK_TDEF(pType, pName) typedef pType (* pName)
- #else
- #define GE_CALLBACK(pType, pName) pascal pType pName
- #define GE_CALLBACK_TDEF(pType, pName) typedef pascal pType (* pName)
- #endif
- #endif
-
- // Mac-specific issues
- #if defined(TARGET_IS_MACOS)
-
- //Are we using the new headers?
- #if defined(__CONDITIONALMACROS__)
- #define NEWHEADERS 1
- #else
- #define NEWHEADERS 0
- #endif
-
- //Is this for the PowerMac?
- #if (defined(powerc) || defined(__powerc))
- #define FORPPC 1
- #else
- #define FORPPC 0
- #endif
-
-
- //Get Toolbox symbols if we're compiling in MPW
-
- #if !defined(TEST_COMPILE) && defined(applec) && !defined(__cplusplus)
- #pragma load "::ToolKit.precompile"
- #endif
-
- #if !defined(TEST_COMPILE)
- #include <timer.h>
- #ifndef _QDOFFSCREEN__
- #include <QDOffscreen.h>
- #endif
- #endif
-
- #define FastCopyBits QuickCopyBits
-
- #endif //TARGET_IS_MACOS
-
- // Windows-specific issues
- #if defined(TARGET_IS_WIN95)
-
- // Set to 1 to use DirectDraw version
- #define USING_DIRECTDRAW 0
-
- #if !defined(TEST_COMPILE)
-
- #include <windows.h>
-
- #if USING_DIRECTDRAW
- #define CINTERFACE
- #include <ddraw.h>
- #undef CINTERFACE
- #endif
-
- // QuickDraw analogs for Win95
- #include "GEQDraw.h"
-
-
- typedef BOOL Boolean;
- #ifndef false
- #define false 0
- #endif
- #ifndef true
- #define true 1
- #endif
-
- #if false != 0
- #error "false must be 0"
- #endif
- #if true != 1
- #error "true must be 1"
- #endif
-
- typedef unsigned char FAR * Ptr;
- typedef Ptr * Handle;
-
- typedef char FAR * StringPtr;
- typedef char Str255 [256];
-
- #ifndef nil
- #define nil 0
- #endif
-
- #endif
- #endif //TARGET_IS_WIN95
-
- #if defined(TARGET_IS_BEOS)
-
- typedef bool Boolean;
- typedef unsigned char *Ptr;
- typedef Ptr *Handle;
- typedef unsigned char Str255[256];
- typedef unsigned char *StringPtr;
- #define nil NULL
- #include "GEQDraw.h"
-
- #endif //TARGET_IS_BEOS
-
-
- // Define all internally used symbols for test compiles
-
- #if defined(TEST_COMPILE)
-
- typedef enum {false, true} Boolean;
- typedef struct {int top; int left; int right; int bottom;} Rect;
- typedef unsigned long RgnHandle;
- typedef struct { short h; short v; } Point;
-
- typedef unsigned char * Ptr;
- typedef Ptr * Handle;
-
- typedef char * StringPtr;
-
- #define nil 0
-
- #endif
-
- #endif // define preload
-